import request from '@/request/request'

/* 获取部门的接口 */
export const getDepartmentsListAPI = () => {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

/* 删除部门的接口 */
export const deleteDepartmentsAPI = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

/* 新增部门的接口 */
export const addDepartmentsAPI = (data) => {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

/* 查询部门详情的接口 */
export const findDepartmentsAPI = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

/* 修改部门详情的接口 */
export const updateDepartmentsAPI = (data) => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

/* 获取部门负责人的接口 */
export const getSimpleEmployeeAPI = () => {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}
